<template>
    <div>
        <!-- 面包屑组件 -->
        <BreadCrumb></BreadCrumb>
        <!-- 添加按钮组件 -->
        <el-button type="primary" plain class="m20" @click="add">添加</el-button>
        <!-- 列表组件 -->
        <List @edit="editItem"></List>
        <!-- 弹窗组件 -->
        <Dialog :isShow="isShow" @cancel="cancel" ref="dialog" :isAdd="isAdd"></Dialog>
    </div>
</template>

<script setup>
import List from './list.vue'
import Dialog from './dialog'
import {ref} from 'vue'
let isShow = ref(false)
let isAdd = ref(true)
// 添加
const add = ()=>{
    isShow.value = true
}
// 关闭弹窗
const cancel = ()=>{
    isShow.value = false
}
let dialog = ref()
// 编辑
const editItem = (id)=>{
    isShow.value = true
    isAdd.value = false
    dialog.value.lookup(id)
}
</script>

<style>

</style>